#!/bin/sh
#
# Build QT library.
# http://maxwit.googlecode.com
#


# QT Packages List
export QTOPIA_VERSION=qtopia-opensource-src-4.3.2

# download package for qtopia
${MWL_TOP}/linux/lib/download.sh qtopia

cd ${BUILD_PATH}

QPE_VERSION=qtopia-opensource-4.3.2
echo -n "Extracting ${QPE_VERSION} ..."
rm -rf ${QPE_VERSION}
tar zxf ${SRC_PATH}/${QTOPIA_VERSION}.tar.gz || exit
sed -i 's/\(O_CREAT.*O_WRONLY\)/\1, 0666/' ${QPE_VERSION}/src/libraries/qtopiabase/qmemoryfile_unix.cpp
echo "OK."

echo -n "Building ${QPE_VERSION} ... "
mkdir -p ${BUILD_PATH}/qtopia_build
cd ${BUILD_PATH}/qtopia_build

${BUILD_PATH}/${QPE_VERSION}/configure \
	-prefix /usr \
	-arch arm \
	-xplatform linux-arm-g++ \
	-displaysize 240x320 \
	-no-test \
	-no-examples \
	-no-modem \
	-confirm-license \
	-no-qtopiamedia \
	-no-bluetooth \
	-no-sxe

make || exit
make INSTALL_ROOT=${SYSROOT_PATH} install > ${BUILD_PATH}/log/${QPE_VERSION} 2>&1 || exit

echo
echo "Qtopia Built Successfully! If any Question, Please Contact:"
echo "  Conke  <conke.hu@gmail.com>"
echo "  Linke  <linke.wang@gmail.com>"
echo

